package com.ymttest.common.enums;

/**
 * 优惠券适用用户
 */
public enum CouponUserTypeEnum {
	/**
	 * 全部买家
	 */
	All(0),

	/**
	 * 新用户(1)
	 */
	NewUser(1),

	/**
	 * 老用户(2)
	 */
	OldUser(2);

	private int intValue;
	private static java.util.HashMap<Integer, CouponUserTypeEnum> mappings;

	private synchronized static java.util.HashMap<Integer, CouponUserTypeEnum> getMappings() {
		if (mappings == null) {
			mappings = new java.util.HashMap<Integer, CouponUserTypeEnum>();
		}
		return mappings;
	}

	private CouponUserTypeEnum(int value) {
		intValue = value;
		CouponUserTypeEnum.getMappings().put(value, this);
	}

	public int getValue() {
		return intValue;
	}

	public static CouponUserTypeEnum forValue(int value) {
		return getMappings().get(value);
	}
}